package hngc.com;

import java.util.Scanner;

public class Box6 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int a = 0;
        int b = 0;
        int c = 0;
        int d = 0;
        double Y = 0;
        System.out.println("输入a值：");
        while (scanner.hasNext()) {
            try {
                a = scanner.nextInt();
                System.out.println("输入b值：");
                b = scanner.nextInt();
                System.out.println("输入c值：");
                c = scanner.nextInt();
                System.out.println("输入d值：");
                d = scanner.nextInt();
                break;
            } catch (Exception e) {
                System.out.println("必须输入整数");
                return;
            }
        }
        System.out.println(a + b + c + d);
        if ((a > 12 && b < 13) && (c > 4 || d < 20)) {
            Y = 3 * a + 10 * b + 5 * d - c;
            System.out.println("Y:" + Y);
        } else {
            Y = 10 * d - (a + b) * c / 5;
            System.out.println("Y:" + Y);
        }
        scanner.close();
    }
}
